#pragma once
#include"RBTree.hpp"


template<class K>
class my_set {
public:
	struct SetKeyOfT {
		const K& operator()(const K& key) {
			return key;
		}
	};
	typedef typename RBTree<K, K, SetKeyOfT>::iterator iterator;
	iterator begin() {
		return _t.begin();
	}
	iterator end() {
		return  _t.end();
	}
	pair<iterator, bool> Insert(const K& key) {
		return _t.Insert(key);
	}

	K& operator[](const K& key) {
		pair<iterator, bool> ret = Insert(key);
		return ret.first;
	}

private:
	RBTree<K,K,SetKeyOfT> _t;
};